﻿using ITXHWEB.Models;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Web.Mvc;
using WPFExcelReport;
using WPFExcelReport.Helpers;
using ITXHWEB.Infrastructure;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace ITXHWEB.Controllers
{
    public partial class WBFEHLController : ITXController
    { 

        public WBFEHLController()
        {


        } 
        public void OnInspection()
        {
            ViewBag.IsAMRunReady = MABF.IsAMRunReady;
            ViewBag.IsEXORDReady = MABF.IsEXORDReady;
            ViewBag.IsSTKNRReady = MABF.IsSTKNRReady;
            ViewBag.IsERKReady = MABF.CWBB.IsERKReady; 
        }
        public ActionResult OnEKEYChg(string EPOS, string EKEY)
        {
            var query = from WBFEHLModel model in MABF.CWBB.CERK.ERRORS.AsEnumerable()
                        where model.EPOS == EPOS
                        select model;
            foreach (WBFEHLModel model in query)
            {
                model.EKEY = EKEY;
                MABF.CWBB.CERK.CERROR.dwMaster["WBFFSCHL"] = model.EKEY;
            }
            return View();
        }
    }
}
